import xlrd

data = xlrd.open_workbook('test.xlsx')
table = data.sheets()[0]

# 获取所有行数
nrows = table.nrows
# 获取所有列数
ncols = table.ncols
# print('行',nrows,'列',ncols)

# 获取单元格的值
for h in range(nrows):
    for l in range(ncols):
        # 输出每一行数据 一行数据在一行显示
        print(table.cell_value(h,l),end='\t')
    print()
